cmake_minimum_required(VERSION 3.5)

project(qtvplugin_geomarker VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)

set(PRJ_HEADERS
    ../qtviewer_planetosm/osmtiles/layer_interface.h
    ../qtviewer_planetosm/osmtiles/viewer_interface.h
    qtvplugin_geomarker.h
    geographicsellipseitem.h
    geoitembase.h
    geographicsscene.h
    geographicsrectitem.h
    geographicslineitem.h
    geographicspolygonitem.h
    geographicspixmapitem.h
    dialogselecticon.h
    geographicsmultilineitem.h
)

set(PRJ_SOURCES
    qtvplugin_geomarker.cpp
    geographicsellipseitem.cpp
    geoitembase.cpp
    geographicsscene.cpp
    geographicsrectitem.cpp
    qtvplugin_geomarker_uimethods.cpp
    geographicslineitem.cpp
    geographicspolygonitem.cpp
    qtvplugin_geomarker_func.cpp
    qtvplugin_geomarker_xml.cpp
    geographicspixmapitem.cpp
    dialogselecticon.cpp
    geographicsmultilineitem.cpp
)

set(PRJ_FORMS
    qtvplugin_geomarker.ui
    dialogselecticon.ui
)

set(PRJ_RESOURCES
    resources.qrc
    qtvplugin_geomarker_zh_CN.ts
)

add_library(qtvplugin_geomarker SHARED
    ${PRJ_HEADERS}
    ${PRJ_SOURCES}
    ${PRJ_FORMS}
    ${PRJ_RESOURCES}
)

target_compile_definitions(qtvplugin_geomarker PRIVATE PLANETOSM_EXPORT_DLL)
target_link_libraries(qtvplugin_geomarker PRIVATE
    Qt${QT_VERSION_MAJOR}::Widgets
)
